<?php include('header.php')?>
<?php
use \LaneWeChat\Core\Db;
use \LaneWeChat\Core\Ext;
include '/var/www/html/wx/wechat/core/ext.lib.php';
include '/var/www/html/wx/wechat/core/db.lib.php';
$accounts = \LaneWeChat\Core\Ext::AccountList($_SESSION['sid']);
?>
<title>微信公众号配置</title>
</head>
<body>
	<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
		<div class="container-fluid">
			<ul class="nav navbar-nav">
				<li><a href="http://www.12301.cc"><i class="fa fa-reply-all"></i>返回系统</a></li>
			</ul>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row">
            <?php include('leftbar.php')?>
            <div class="col-xs-12 col-sm-9 col-lg-10">
                <iframe src="about:blank" style="display: none;height: 0;width: 0;" id="_hide_frame_" name="_hide_frame_" frameborder="0"></iframe>
                <form class="form form-horizontal" action="ichat.php?action=" enctype="multipart/form-data" method="post" target="_hide_frame_">
                <?php include 'acc_info.php';?>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="javascript:;">欢迎消息</a></li>
                    <li><a href="javascript:;">默认回复</a></li>
                </ul>
                <div class="clearfix">
                    <input name="action" type="hidden" value="UploadImage"/>
                    <div class="panel panel-default">
                        <div class="panel-heading"> 欢迎消息</div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-xs-12 col-sm-3 col-md-2 control-label">标题</label>
                                <div class="col-sm-9">
                                    <input type="file" class="form-control" placeholder="添加图文消息的标题" name="image">
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-sm-12">
                            <input name="submit" type="submit" value="提交" class="btn btn-primary col-lg-1">
                        </div>
                    </div>
                </div>
                </form>
            </div>
		</div>

	</div>
    <?php include('footer.php')?>
    <script>
        $(function(){
            WXB.G.SwitchAccount.init(function(){
                AutoReply.init();
            });
            var elem_txt = $("#txt_msg_wrap"),
                elem_img = $("#img_msg_wrap");
            elem_img.find('input').attr('disabled','disabled');
            $("input[name=msg_type]").on('click', function(){
                if ($(this).val()=='IMAGE') {
                    elem_txt.hide();
                    elem_txt.find('input').attr('disabled','disabled');
                    elem_img.show();
                    elem_img.find('input').removeAttr('disabled');
                } else {
                    elem_img.hide();
                    elem_img.find('input').attr('disabled','disabled');
                    elem_txt.show();
                    elem_txt.find('input').removeAttr('disabled');
                }
            });


        });
    </script>
</body>